import $http from '@/common/http.config.js'

export const login = (params) => $http.post('/api/admin/login', params)
export const getUserIncomeTotal = (params) => $http.post('/api/admin/getUserIncomeTotal', params)
export const getUserIncomeDataSort = (params) => $http.post('/api/admin/getUserIncomeDataSort', params)
export const getWalletApply = (params) => $http.post('/api/admin/getWalletApply', params)
export const getSubUser = (params) => $http.post('/api/admin/getSubUser', params)
export const getUserData = (params) => $http.post('/api/admin/getUserData', params)
export const getUserIncomeData = (params) => $http.post('/api/admin/getUserIncomeData', params)
export const getUserIncome = (params) => $http.post('/api/admin/getUserIncome', params)
export const getSubUserDetail = (params) => $http.get('/api/admin/getSubUserDetail?id=' + params)

export const getWxMiniProgramSessionKey = (params) => $http.post('/api/iweighing/user/account/getWxMiniProgramSessionKey', params)
export const wxMiniProgramOauth = (params) => $http.post('/api/iweighing/user/account/wxMiniProgramOauth', params)
export const getUserInfo = (params) => $http.get('/api/iweighing/user/account/userInfo', params)
export const getVehicleList = (params) => $http.get('/api/iweighing/user/vehicle/list', params)

// 提交过磅
export const createOrder = (params) => $http.post('/api/iweighing/user/order/create', params)

export const getWeighingRecord = (params) => $http.get('/api/iweighing/user/weighing/record', params)
export const addCar = (params) => $http.post('/api/iweighing/user/vehicle/create', params)
export const getPoundBill = (params) => $http.post('/api/iweighing/user/order/list', params)
export const getPoundBillDetail = (params) => $http.post('/api/iweighing/user/order/detail', params)

export const getNearbyList = (params) => $http.post('/api/iweighing/user/device/list_nearby', params)
export const orderPay = (params) => $http.post('/api/iweighing/user/order/pay', params)

export const amend_config = (params) => $http.get('/api/iweighing/user/weighing/amend_config', params)

export const lastPayedOrder = () => $http.get('/api/iweighing/user/order/lastPayedOrder')

export const paymentOrderList = (params) => $http.post('/api/iweighing/merchant/order/paymentOrderList', params)
export const deviceList = () => $http.get('/api/iweighing/merchant/device/device/list')
